<template>
    <ListPage ref="page" :query="query" :api="getRenewYwList">
        <template #search="{ page, hiddenColumns }">
            <PageSearch ref="search" :query="query" :page="page" has-box @search="() => ($refs.page as any).getData()">
                <template #auth>
                </template>
                <template #input="{ }">
                    <SearchInput v-model="query.keyword" placeholder="客户名称/店铺名称" :data="query"
                        :hidden-columns="(hiddenColumns as any)" @trigger="(e) => ($refs.search as any).trigger(e)"
                        @search="() => ($refs.page as any).getData()"
                        @change-column="(prop) => ($refs.page as any).changeColumn(prop)"></SearchInput>
                </template>
            </PageSearch>
        </template>

        <template #table="{ data, hiddenColumns }">
            <ListTable :data="data" :hidden-columns="(hiddenColumns as any)">
            </ListTable>
        </template>

        <template #pagination="{ page, total }">
            <PagePagination :page="page" :total="total" @changePage="(v) => ($refs.page as any).changePage(v)">
            </PagePagination>
        </template>
    </ListPage>
</template>

<script setup lang="ts">
import { ref, reactive } from 'vue'
import ListPage from '@/components/list-page/ListPage.vue'
import PageSearch from '@/components/list-page/PageSearch.vue'
import SearchInput from '@/components/list-page/SearchInput.vue'
import PagePagination from '@/components/list-page/PagePagination.vue'
import ListTable from './ListTable.vue'

const query = reactive({
    keyword: ''
})

import { getRenewYwList } from '../api'

</script>